﻿function AjaxWithBlock(blockObj, url, requestData, success) {
    blockObj.block(
            {
                message: $('<img src="' + window.loadingImageUrl + '" style="display: none;" />'),
                css: {
                    top: (blockObj.height() - 20) / 2 + 'px',
                    left: (blockObj.width() - 220) / 2 + 'px',
                    border: '0px',
                    width: '220px',
                    backgroundColor: '#000000'
                },
                overlayCSS: { backgroundColor: '#eeeeee' }
            }
        );
    $.ajax({
        type: 'Get',
        url: url,
        data: requestData,
        success: function (data) {
            if (success) {
                success(data);
            }
            blockObj.unblock();
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            debugger;
        },
        async: true
    });
}